package com.shadow.baiqun.delegate;

import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;

import com.shadow.baiqun.delegate.mine.MineDelegate;
import com.shadow.baiqun.delegate.receive.ReceiveDelegate;
import com.shadow.baiqun.delegate.room.RoomDelegate;
import com.shadow.baiqun.delegate.send.SendDelegate;
import com.shadow.baiqun.event.LogoutEvent;
import com.shadow.baiqun.global.GlobalDataManager;
import com.shadow.core.delegate.bottom.BaseBottomDelegate;
import com.shadow.core.delegate.bottom.BottomItemDelegate;
import com.shadow.core.delegate.bottom.BottomTitleBean;
import com.shadow.core.delegate.bottom.ItemBuilder;
import com.shadow.core.net.callback.IError;
import com.shadow.core.net.callback.ISuccess;
import com.shadow.core.net.rx.RxRestClient;

import org.greenrobot.eventbus.Subscribe;

import java.util.LinkedHashMap;

import io.reactivex.disposables.Disposable;

/**
 * @author zy
 * on 2018/5/19
 */
public class HomeDelegate extends BaseBottomDelegate {

    @Override
    public LinkedHashMap<BottomTitleBean, BottomItemDelegate> setItems(ItemBuilder builder) {
        final LinkedHashMap<BottomTitleBean, BottomItemDelegate> items = new LinkedHashMap<>();

        items.put(new BottomTitleBean("{icon-receive}", "收货"), new ReceiveDelegate());
        items.put(new BottomTitleBean("{icon-warehouse}", "库内"), new RoomDelegate());
        items.put(new BottomTitleBean("{icon-send}", "发货"), new SendDelegate());
        items.put(new BottomTitleBean("{icon-mine}", "我的"), new MineDelegate());
        return builder.addItems(items).build();
    }

    @Override
    public int setIndexDelegate() {
        return 0;
    }

    @Override
    public int setClickColor() {
        return Color.parseColor("#2383bf");
    }

    @Override
    public int setBackground() {
        return Color.parseColor("#f0f0f0");
    }

    @Subscribe
    public void onLogout(LogoutEvent event) {
        pop();
    }



}
